﻿#region itdc

/************************************************************************
*Copyright(C) 2015 by qsgy
 *All rights reserved. 
 *FileName:     $safeitemname$
 *Author:       oyh
 *Version:      
 *UnityVersion：
 *Date:   $time$      
 *Description:    
 *History: 
************************************************************************/
#endregion
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum TransitionID
{
    Null,SeePlayer,Timer
}

public abstract class Transition : MonoBehaviour {
    [Tooltip("用于识别的名字，打包可去掉")]
    public string onlyName;
    [Header("Context")]
    [Tooltip("唯一识别的转换id"),ReadOnly,SerializeField]
    protected TransitionID id;
    public TransitionID ID
   {
        get { return id; }
    }

    /// <summary>
    /// 是否符合转换条件
    /// 会在一个system的freshtime中刷新
    /// </summary>
    /// <returns></returns>
    public abstract bool IsTransition();

    /// <summary>
    /// 状态转为当前状态时，激活条件，初始化条件
    /// </summary>
    public virtual void Enter() { }
    /// <summary>
    /// 状态退出时，条件退出
    /// </summary>
    public virtual void Exit() { }
   
}
